/**
 * @author schranz
* Register commands to respond to notifications
*
*/
package com.nikitova.craps3d.controller 
{
	import com.nikitova.craps3d.constants.Notifications;
	import com.nikitova.craps3d.constants.statemachine.StateTransitions;
	import com.nikitova.craps3d.controller.*;
	
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	import org.puremvc.as3.multicore.utilities.startupmanager.controller.StartupResourceFailedCommand;
	import org.puremvc.as3.multicore.utilities.startupmanager.controller.StartupResourceLoadedCommand;
	import org.puremvc.as3.multicore.utilities.startupmanager.model.StartupMonitorProxy;	

	public class ControllerPrepCommand extends SimpleCommand
	{
		override public function execute( note : INotification ) : void    
		{
			// *** startup manager registrations
			facade.registerCommand(Notifications.CONFIG_LOADED,			  	StartupResourceLoadedCommand);
			facade.registerCommand(Notifications.GAME_CONFIG_LOADED,     	StartupResourceLoadedCommand);
			facade.registerCommand(Notifications.CONFIG_LOAD_FAILED,	  	StartupResourceFailedCommand);
			facade.registerCommand(Notifications.GAME_CONFIG_LOAD_FAILED, 	StartupResourceFailedCommand);
			facade.registerCommand(Notifications.MATERIALS_LOADED,			StartupResourceLoadedCommand);
			facade.registerCommand(Notifications.COLLADA_LOADED,			StartupResourceLoadedCommand);
			facade.registerCommand(Notifications.COLLADA_LOAD_FAILED,		StartupResourceFailedCommand);

			facade.registerCommand(Notifications.INIT_CONFIG,				InitializeProxiesCommand);
			facade.registerCommand(Notifications.INIT_GAME_CONFIG,      	InitializeProxiesCommand);
			facade.registerCommand(StartupMonitorProxy.LOADING_COMPLETE,	InitializeProxiesCommand);		
			
			// *** game command registrations
			facade.registerCommand(Notifications.STARTUP, 					StartupCommand);
			facade.registerCommand(StateTransitions.SHOW_PRELOADER, 		LoadGameDataCommand);
			facade.registerCommand(StateTransitions.SHOW_BET_STATE, 		MouseManagerCommand);		
			facade.registerCommand(StateTransitions.SHOW_ROLL_STATE, 		MouseManagerCommand);	
		}
	}
}
